/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package siru;

import DAOs.PeasantJpaController;
import DAOs.exceptions.NonexistentEntityException;
import Entity.Peasant;
import Interface.Panel.PanelPeasantRegister;
import Interface.Windows.MainWindow;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *
 * @author USUARIO
 */
public class SIRU {
     
    public SIRU() throws NonexistentEntityException{
        EntityManagerFactory emf = Persistence.createEntityManagerFactory("SIRUPU", System.getProperties());
        Peasant p = new Peasant();
        p.setName("Hola");
        p.setLastname("Hola2");
        p.setCedula(123456789);
        p.setAge("18");
        PeasantJpaController pjpa = new PeasantJpaController(emf);
        pjpa.create(p);
        
        //PanelPeasantRegister peasantInterface = new PanelPeasantRegister(emf);
        //MainWindow window = new MainWindow();
        //window.setVisible(true);
        //window.setPanel(peasantInterface);
    }
    
    public static void main(String[] args) throws NonexistentEntityException {
        SIRU siru = new SIRU();
    }
}
